package com.chain.BrotherExchange.data.model;

import android.support.annotation.NonNull;

import java.util.List;

/**
 * 买卖盘
 */
public class EntrustQueue extends BaseResponseModel<EntrustQueue.DataBean> {

    public static EntrustQueue.DataBean.Bean createEmpty() {
        return new DataBean.Bean("0", "0", "0", "0");
    }


    public static class DataBean {
        private List<Bean> buy;
        private List<Bean> sell;

        public DataBean() {
        }

        public DataBean(List<Bean> buy, List<Bean> sell) {

            this.buy = buy;
            this.sell = sell;
        }

        public List<Bean> getBuy() {
            return buy;
        }

        public void setBuy(List<Bean> buy) {
            this.buy = buy;
        }

        public List<Bean> getSell() {
            return sell;
        }

        public void setSell(List<Bean> sell) {
            this.sell = sell;
        }

        public static class Bean implements Comparable<Bean> {
            public Bean() {
            }

            public int getType() {
                return type;
            }

            public void setType(int type) {
                this.type = type;
            }

            public Bean(String price, String surplus_num, String on_price, String cny_price) {
                this.on_price = on_price;
                this.cny_price = cny_price;
                this.price = price;
                this.surplus_num = surplus_num;
            }

            /**
             * price : 223.332
             * surplus_num : 1006
             * on_price : 0.222
             * cny_price : 0.06
             */
            private int type;
            private String price = "0";
            private String surplus_num = "0";
            private String on_price = "0";
            private String cny_price = "0";

            public String getPrice() {
                return price;
            }

            public void setPrice(String price) {
                this.price = price;
            }

            public String getSurplus_num() {
                return surplus_num;
            }

            public void setSurplus_num(String surplus_num) {
                this.surplus_num = surplus_num;
            }

            public String getOn_price() {
                return on_price;
            }

            public void setOn_price(String on_price) {
                this.on_price = on_price;
            }

            public String getCny_price() {
                return cny_price;
            }

            public void setCny_price(String cny_price) {
                this.cny_price = cny_price;
            }


            @Override
            public int compareTo(@NonNull Bean o) {
                return Double.compare(Double.parseDouble(this.on_price), Double.parseDouble(o.on_price));
            }
        }
    }
}
